﻿using FluentValidation;
using Mes.Application.DTO.Inputs.Quality;

namespace Mes.Application.Web.Validators.Quality
{
    public class UpdatingCharacteristicInputValidator : AbstractValidator<UpdatingCharacteristicInput>
    {
        public UpdatingCharacteristicInputValidator()
        {
            RuleFor(x => x.Char_Name).Length(1, 40).WithMessage("特征名称长度必须在1到40之间");
            RuleFor(x => x.Char_Desc).Length(0, 80).WithMessage("特征描述长度必须在0到80之间");
            RuleFor(x => x.Num_Decimals).GreaterThanOrEqualTo(0).WithMessage("小数位数必须大于等于0").LessThanOrEqualTo(7).WithMessage("小数位数必须小于等于7");
        }
    }
}
